// yb_mingpian/pages/ruzhu/store.js
var t = getApp(),
  a = t.requirejs("core"),
  s = t.requirejs("wxParse/wxParse");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    code:0,
    msg: '',
    count_finish_order: 0,
    count_nopay_order: 0,
    count_nosend_order: 0,
    count_send_order: 0,
    count_tody_order: 0,
    count_tody_order_finish: 0,
    tody_money: 0,
    count_total: 0,
    order_status:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    this.clickme()
  },
  tojiesuan:function(e){
    wx.navigateTo({
      url: '/yb_mingpian/pages/ruzhu/jiesuan',
    })
  },
  tomingxi:function(e){
    wx.navigateTo({
      url: '/yb_mingpian/pages/ruzhu/mingxi',
    })
  },
  toorder:function(e){
    let state = e.currentTarget.dataset.state
    console.log(state)
    wx.navigateTo({
      url: '/yb_mingpian/pages/ruzhu/dingdan?id='+state,
    })
  },
  toguanli: function(){
    wx.navigateTo({
      url: '/yb_mingpian/pages/ruzhu/guanli',
    })
  },
  totianjia: function(){
    wx.navigateTo({
      url: '/yb_mingpian/pages/ruzhu/tianjia',
    })
  },
  clickme: function () {
    var o = this
     a.get("Card/MyStore", {
        uid: getApp().getCache("userinfo").uid,
      }, function (res) {
        console.log(res)
        o.setData({
          count_finish_order : res.count_finish_order
        })
        o.setData({
          count_nopay_order : res.count_nopay_order
        })
        o.setData({
          count_nosend_order : res.count_nosend_order
        })
        o.setData({
          count_send_order : res.count_send_order
        })
        o.setData({
          count_tody_order : res.count_tody_order
        })
        o.setData({
          count_tody_order_finish : res.count_tody_order_finish
        })
        o.setData({
          tody_money : res.tody_money
        })
        o.setData({
          count_total : res.count_total
        })
        o.setData({
          code : res.code
        })
        o.setData({
          msg : res.info
        })
        // console.log(o.data.progress);
        // console.log(o.data.pass);
      })
    },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})